package com.inmobi.re.container.mraidimpl;

import android.app.Activity;
import android.content.ActivityNotFoundException;
import android.content.Intent;
import android.net.Uri;
import android.webkit.URLUtil;
import com.inmobi.androidsdk.IMBrowserActivity;
import com.inmobi.commons.internal.InternalSDKUtil;
import com.inmobi.commons.internal.Log;
import com.inmobi.re.container.IMWebView;
import com.inmobi.re.container.IMWebView.IMWebViewListener;
import com.inmobi.re.container.IMWebView.ViewState;

public class MRAIDBasic
{
  private IMWebView a;
  private Activity b;

  public MRAIDBasic(IMWebView paramIMWebView, Activity paramActivity)
  {
    this.a = paramIMWebView;
    this.b = paramActivity;
  }

  // ERROR //
  public void getCurrentPosition()
  {
    // Byte code:
    //   0: fconst_0
    //   1: fstore_1
    //   2: ldc 26
    //   4: ldc 28
    //   6: invokestatic 34	com/inmobi/commons/internal/Log:debug	(Ljava/lang/String;Ljava/lang/String;)V
    //   9: new 36	org/json/JSONObject
    //   12: dup
    //   13: invokespecial 37	org/json/JSONObject:<init>	()V
    //   16: astore_2
    //   17: aload_0
    //   18: getfield 15	com/inmobi/re/container/mraidimpl/MRAIDBasic:a	Lcom/inmobi/re/container/IMWebView;
    //   21: invokevirtual 43	com/inmobi/re/container/IMWebView:isViewable	()Z
    //   24: ifeq +356 -> 380
    //   27: iconst_2
    //   28: newarray int
    //   30: astore 33
    //   32: aload_0
    //   33: getfield 15	com/inmobi/re/container/mraidimpl/MRAIDBasic:a	Lcom/inmobi/re/container/IMWebView;
    //   36: aload 33
    //   38: invokevirtual 47	com/inmobi/re/container/IMWebView:getLocationOnScreen	([I)V
    //   41: aload 33
    //   43: iconst_0
    //   44: iaload
    //   45: istore 15
    //   47: aload 33
    //   49: iconst_1
    //   50: iaload
    //   51: istore 14
    //   53: aload_0
    //   54: getfield 15	com/inmobi/re/container/mraidimpl/MRAIDBasic:a	Lcom/inmobi/re/container/IMWebView;
    //   57: invokevirtual 51	com/inmobi/re/container/IMWebView:getWidth	()I
    //   60: i2f
    //   61: fstore 37
    //   63: aload_0
    //   64: getfield 15	com/inmobi/re/container/mraidimpl/MRAIDBasic:a	Lcom/inmobi/re/container/IMWebView;
    //   67: invokevirtual 55	com/inmobi/re/container/IMWebView:getDensity	()F
    //   70: fstore_1
    //   71: fload 37
    //   73: fload_1
    //   74: fdiv
    //   75: f2i
    //   76: fstore_1
    //   77: aload_0
    //   78: getfield 15	com/inmobi/re/container/mraidimpl/MRAIDBasic:a	Lcom/inmobi/re/container/IMWebView;
    //   81: invokevirtual 58	com/inmobi/re/container/IMWebView:getHeight	()I
    //   84: i2f
    //   85: fstore 38
    //   87: aload_0
    //   88: getfield 15	com/inmobi/re/container/mraidimpl/MRAIDBasic:a	Lcom/inmobi/re/container/IMWebView;
    //   91: invokevirtual 55	com/inmobi/re/container/IMWebView:getDensity	()F
    //   94: fstore 39
    //   96: fload 38
    //   98: fload 39
    //   100: fdiv
    //   101: f2i
    //   102: istore 40
    //   104: iload 15
    //   106: istore 27
    //   108: iload 14
    //   110: istore 26
    //   112: fload_1
    //   113: fstore 25
    //   115: iload 40
    //   117: istore 24
    //   119: aload_2
    //   120: ldc 60
    //   122: iload 27
    //   124: invokevirtual 64	org/json/JSONObject:put	(Ljava/lang/String;I)Lorg/json/JSONObject;
    //   127: pop
    //   128: aload_2
    //   129: ldc 66
    //   131: iload 26
    //   133: invokevirtual 64	org/json/JSONObject:put	(Ljava/lang/String;I)Lorg/json/JSONObject;
    //   136: pop
    //   137: aload_2
    //   138: ldc 68
    //   140: fload 25
    //   142: invokevirtual 64	org/json/JSONObject:put	(Ljava/lang/String;I)Lorg/json/JSONObject;
    //   145: pop
    //   146: aload_2
    //   147: ldc 70
    //   149: iload 24
    //   151: invokevirtual 64	org/json/JSONObject:put	(Ljava/lang/String;I)Lorg/json/JSONObject;
    //   154: pop
    //   155: aload_0
    //   156: getfield 15	com/inmobi/re/container/mraidimpl/MRAIDBasic:a	Lcom/inmobi/re/container/IMWebView;
    //   159: getfield 74	com/inmobi/re/container/IMWebView:mutexcPos	Ljava/lang/Object;
    //   162: astore 18
    //   164: aload 18
    //   166: monitorenter
    //   167: aload_0
    //   168: getfield 15	com/inmobi/re/container/mraidimpl/MRAIDBasic:a	Lcom/inmobi/re/container/IMWebView;
    //   171: aload_2
    //   172: putfield 78	com/inmobi/re/container/IMWebView:curPosition	Lorg/json/JSONObject;
    //   175: aload_0
    //   176: getfield 15	com/inmobi/re/container/mraidimpl/MRAIDBasic:a	Lcom/inmobi/re/container/IMWebView;
    //   179: getfield 82	com/inmobi/re/container/IMWebView:acqMutexcPos	Ljava/util/concurrent/atomic/AtomicBoolean;
    //   182: iconst_0
    //   183: invokevirtual 88	java/util/concurrent/atomic/AtomicBoolean:set	(Z)V
    //   186: aload_0
    //   187: getfield 15	com/inmobi/re/container/mraidimpl/MRAIDBasic:a	Lcom/inmobi/re/container/IMWebView;
    //   190: getfield 74	com/inmobi/re/container/IMWebView:mutexcPos	Ljava/lang/Object;
    //   193: invokevirtual 91	java/lang/Object:notifyAll	()V
    //   196: aload 18
    //   198: monitorexit
    //   199: return
    //   200: astore 13
    //   202: iconst_0
    //   203: istore 14
    //   205: iconst_0
    //   206: istore 15
    //   208: ldc 26
    //   210: ldc 93
    //   212: invokestatic 34	com/inmobi/commons/internal/Log:debug	(Ljava/lang/String;Ljava/lang/String;)V
    //   215: aload_2
    //   216: ldc 60
    //   218: iload 15
    //   220: invokevirtual 64	org/json/JSONObject:put	(Ljava/lang/String;I)Lorg/json/JSONObject;
    //   223: pop
    //   224: aload_2
    //   225: ldc 66
    //   227: iload 14
    //   229: invokevirtual 64	org/json/JSONObject:put	(Ljava/lang/String;I)Lorg/json/JSONObject;
    //   232: pop
    //   233: aload_2
    //   234: ldc 68
    //   236: fload_1
    //   237: invokevirtual 64	org/json/JSONObject:put	(Ljava/lang/String;I)Lorg/json/JSONObject;
    //   240: pop
    //   241: aload_2
    //   242: ldc 70
    //   244: iconst_0
    //   245: invokevirtual 64	org/json/JSONObject:put	(Ljava/lang/String;I)Lorg/json/JSONObject;
    //   248: pop
    //   249: goto -94 -> 155
    //   252: astore 17
    //   254: goto -99 -> 155
    //   257: astore_3
    //   258: iconst_0
    //   259: istore 4
    //   261: iconst_0
    //   262: istore 5
    //   264: fconst_0
    //   265: fstore 6
    //   267: aload_3
    //   268: astore 7
    //   270: aload_2
    //   271: ldc 60
    //   273: iload 5
    //   275: invokevirtual 64	org/json/JSONObject:put	(Ljava/lang/String;I)Lorg/json/JSONObject;
    //   278: pop
    //   279: aload_2
    //   280: ldc 66
    //   282: iload 4
    //   284: invokevirtual 64	org/json/JSONObject:put	(Ljava/lang/String;I)Lorg/json/JSONObject;
    //   287: pop
    //   288: aload_2
    //   289: ldc 68
    //   291: fload 6
    //   293: invokevirtual 64	org/json/JSONObject:put	(Ljava/lang/String;I)Lorg/json/JSONObject;
    //   296: pop
    //   297: aload_2
    //   298: ldc 70
    //   300: iconst_0
    //   301: invokevirtual 64	org/json/JSONObject:put	(Ljava/lang/String;I)Lorg/json/JSONObject;
    //   304: pop
    //   305: aload 7
    //   307: athrow
    //   308: astore 19
    //   310: aload 18
    //   312: monitorexit
    //   313: aload 19
    //   315: athrow
    //   316: astore 8
    //   318: goto -13 -> 305
    //   321: astore 35
    //   323: iload 15
    //   325: istore 5
    //   327: aload 35
    //   329: astore 7
    //   331: fconst_0
    //   332: fstore 6
    //   334: iconst_0
    //   335: istore 4
    //   337: goto -67 -> 270
    //   340: astore 16
    //   342: iload 15
    //   344: istore 5
    //   346: iload 14
    //   348: istore 4
    //   350: fload_1
    //   351: fstore 6
    //   353: aload 16
    //   355: astore 7
    //   357: goto -87 -> 270
    //   360: astore 34
    //   362: fconst_0
    //   363: fstore_1
    //   364: iconst_0
    //   365: istore 14
    //   367: goto -159 -> 208
    //   370: astore 36
    //   372: goto -164 -> 208
    //   375: astore 28
    //   377: goto -222 -> 155
    //   380: iconst_0
    //   381: istore 24
    //   383: fconst_0
    //   384: fstore 25
    //   386: iconst_0
    //   387: istore 26
    //   389: iconst_0
    //   390: istore 27
    //   392: goto -273 -> 119
    //
    // Exception table:
    //   from	to	target	type
    //   17	47	200	java/lang/Exception
    //   215	249	252	org/json/JSONException
    //   17	47	257	finally
    //   167	199	308	finally
    //   310	313	308	finally
    //   270	305	316	org/json/JSONException
    //   47	53	321	finally
    //   53	96	340	finally
    //   208	215	340	finally
    //   47	53	360	java/lang/Exception
    //   53	96	370	java/lang/Exception
    //   119	155	375	org/json/JSONException
  }

  // ERROR //
  public void getDefaultPosition()
  {
    // Byte code:
    //   0: fconst_0
    //   1: fstore_1
    //   2: ldc 26
    //   4: ldc 96
    //   6: invokestatic 34	com/inmobi/commons/internal/Log:debug	(Ljava/lang/String;Ljava/lang/String;)V
    //   9: new 36	org/json/JSONObject
    //   12: dup
    //   13: invokespecial 37	org/json/JSONObject:<init>	()V
    //   16: astore_2
    //   17: aload_0
    //   18: getfield 15	com/inmobi/re/container/mraidimpl/MRAIDBasic:a	Lcom/inmobi/re/container/IMWebView;
    //   21: invokevirtual 43	com/inmobi/re/container/IMWebView:isViewable	()Z
    //   24: ifeq +358 -> 382
    //   27: iconst_2
    //   28: newarray int
    //   30: astore 26
    //   32: aload_0
    //   33: getfield 15	com/inmobi/re/container/mraidimpl/MRAIDBasic:a	Lcom/inmobi/re/container/IMWebView;
    //   36: invokevirtual 100	com/inmobi/re/container/IMWebView:getOriginalParent	()Landroid/view/ViewParent;
    //   39: checkcast 102	android/view/View
    //   42: aload 26
    //   44: invokevirtual 103	android/view/View:getLocationOnScreen	([I)V
    //   47: aload 26
    //   49: iconst_0
    //   50: iaload
    //   51: istore 5
    //   53: aload 26
    //   55: iconst_1
    //   56: iaload
    //   57: istore 4
    //   59: aload_0
    //   60: getfield 15	com/inmobi/re/container/mraidimpl/MRAIDBasic:a	Lcom/inmobi/re/container/IMWebView;
    //   63: invokevirtual 100	com/inmobi/re/container/IMWebView:getOriginalParent	()Landroid/view/ViewParent;
    //   66: checkcast 102	android/view/View
    //   69: invokevirtual 104	android/view/View:getWidth	()I
    //   72: i2f
    //   73: fstore 27
    //   75: aload_0
    //   76: getfield 15	com/inmobi/re/container/mraidimpl/MRAIDBasic:a	Lcom/inmobi/re/container/IMWebView;
    //   79: invokevirtual 55	com/inmobi/re/container/IMWebView:getDensity	()F
    //   82: fstore_1
    //   83: fload 27
    //   85: fload_1
    //   86: fdiv
    //   87: f2i
    //   88: fstore_1
    //   89: aload_0
    //   90: getfield 15	com/inmobi/re/container/mraidimpl/MRAIDBasic:a	Lcom/inmobi/re/container/IMWebView;
    //   93: invokevirtual 100	com/inmobi/re/container/IMWebView:getOriginalParent	()Landroid/view/ViewParent;
    //   96: checkcast 102	android/view/View
    //   99: invokevirtual 105	android/view/View:getHeight	()I
    //   102: i2f
    //   103: fstore 28
    //   105: aload_0
    //   106: getfield 15	com/inmobi/re/container/mraidimpl/MRAIDBasic:a	Lcom/inmobi/re/container/IMWebView;
    //   109: invokevirtual 55	com/inmobi/re/container/IMWebView:getDensity	()F
    //   112: fstore 29
    //   114: fload 28
    //   116: fload 29
    //   118: fdiv
    //   119: f2i
    //   120: istore 30
    //   122: fload_1
    //   123: fstore 19
    //   125: iload 30
    //   127: istore 20
    //   129: aload_2
    //   130: ldc 60
    //   132: iload 5
    //   134: invokevirtual 64	org/json/JSONObject:put	(Ljava/lang/String;I)Lorg/json/JSONObject;
    //   137: pop
    //   138: aload_2
    //   139: ldc 66
    //   141: iload 4
    //   143: invokevirtual 64	org/json/JSONObject:put	(Ljava/lang/String;I)Lorg/json/JSONObject;
    //   146: pop
    //   147: aload_2
    //   148: ldc 68
    //   150: fload 19
    //   152: invokevirtual 64	org/json/JSONObject:put	(Ljava/lang/String;I)Lorg/json/JSONObject;
    //   155: pop
    //   156: aload_2
    //   157: ldc 70
    //   159: iload 20
    //   161: invokevirtual 64	org/json/JSONObject:put	(Ljava/lang/String;I)Lorg/json/JSONObject;
    //   164: pop
    //   165: aload_0
    //   166: getfield 15	com/inmobi/re/container/mraidimpl/MRAIDBasic:a	Lcom/inmobi/re/container/IMWebView;
    //   169: getfield 108	com/inmobi/re/container/IMWebView:mutexdPos	Ljava/lang/Object;
    //   172: astore 13
    //   174: aload 13
    //   176: monitorenter
    //   177: aload_0
    //   178: getfield 15	com/inmobi/re/container/mraidimpl/MRAIDBasic:a	Lcom/inmobi/re/container/IMWebView;
    //   181: aload_2
    //   182: putfield 111	com/inmobi/re/container/IMWebView:defPosition	Lorg/json/JSONObject;
    //   185: aload_0
    //   186: getfield 15	com/inmobi/re/container/mraidimpl/MRAIDBasic:a	Lcom/inmobi/re/container/IMWebView;
    //   189: getfield 114	com/inmobi/re/container/IMWebView:acqMutexdPos	Ljava/util/concurrent/atomic/AtomicBoolean;
    //   192: iconst_0
    //   193: invokevirtual 88	java/util/concurrent/atomic/AtomicBoolean:set	(Z)V
    //   196: aload_0
    //   197: getfield 15	com/inmobi/re/container/mraidimpl/MRAIDBasic:a	Lcom/inmobi/re/container/IMWebView;
    //   200: getfield 108	com/inmobi/re/container/IMWebView:mutexdPos	Ljava/lang/Object;
    //   203: invokevirtual 91	java/lang/Object:notifyAll	()V
    //   206: aload 13
    //   208: monitorexit
    //   209: return
    //   210: astore 11
    //   212: iconst_0
    //   213: istore 4
    //   215: iconst_0
    //   216: istore 5
    //   218: aload 11
    //   220: invokevirtual 117	java/lang/Exception:printStackTrace	()V
    //   223: ldc 26
    //   225: new 119	java/lang/StringBuilder
    //   228: dup
    //   229: invokespecial 120	java/lang/StringBuilder:<init>	()V
    //   232: ldc 122
    //   234: invokevirtual 126	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   237: aload 11
    //   239: invokevirtual 130	java/lang/Exception:getMessage	()Ljava/lang/String;
    //   242: invokevirtual 126	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   245: invokevirtual 133	java/lang/StringBuilder:toString	()Ljava/lang/String;
    //   248: invokestatic 34	com/inmobi/commons/internal/Log:debug	(Ljava/lang/String;Ljava/lang/String;)V
    //   251: aload_2
    //   252: ldc 60
    //   254: iload 5
    //   256: invokevirtual 64	org/json/JSONObject:put	(Ljava/lang/String;I)Lorg/json/JSONObject;
    //   259: pop
    //   260: aload_2
    //   261: ldc 66
    //   263: iload 4
    //   265: invokevirtual 64	org/json/JSONObject:put	(Ljava/lang/String;I)Lorg/json/JSONObject;
    //   268: pop
    //   269: aload_2
    //   270: ldc 68
    //   272: fload_1
    //   273: invokevirtual 64	org/json/JSONObject:put	(Ljava/lang/String;I)Lorg/json/JSONObject;
    //   276: pop
    //   277: aload_2
    //   278: ldc 70
    //   280: iconst_0
    //   281: invokevirtual 64	org/json/JSONObject:put	(Ljava/lang/String;I)Lorg/json/JSONObject;
    //   284: pop
    //   285: goto -120 -> 165
    //   288: astore 12
    //   290: goto -125 -> 165
    //   293: astore_3
    //   294: iconst_0
    //   295: istore 4
    //   297: iconst_0
    //   298: istore 5
    //   300: aload_2
    //   301: ldc 60
    //   303: iload 5
    //   305: invokevirtual 64	org/json/JSONObject:put	(Ljava/lang/String;I)Lorg/json/JSONObject;
    //   308: pop
    //   309: aload_2
    //   310: ldc 66
    //   312: iload 4
    //   314: invokevirtual 64	org/json/JSONObject:put	(Ljava/lang/String;I)Lorg/json/JSONObject;
    //   317: pop
    //   318: aload_2
    //   319: ldc 68
    //   321: fload_1
    //   322: invokevirtual 64	org/json/JSONObject:put	(Ljava/lang/String;I)Lorg/json/JSONObject;
    //   325: pop
    //   326: aload_2
    //   327: ldc 70
    //   329: iconst_0
    //   330: invokevirtual 64	org/json/JSONObject:put	(Ljava/lang/String;I)Lorg/json/JSONObject;
    //   333: pop
    //   334: aload_3
    //   335: athrow
    //   336: astore 14
    //   338: aload 13
    //   340: monitorexit
    //   341: aload 14
    //   343: athrow
    //   344: astore 6
    //   346: goto -12 -> 334
    //   349: astore_3
    //   350: fconst_0
    //   351: fstore_1
    //   352: iconst_0
    //   353: istore 4
    //   355: goto -55 -> 300
    //   358: astore_3
    //   359: goto -59 -> 300
    //   362: astore 11
    //   364: fconst_0
    //   365: fstore_1
    //   366: iconst_0
    //   367: istore 4
    //   369: goto -151 -> 218
    //   372: astore 11
    //   374: goto -156 -> 218
    //   377: astore 21
    //   379: goto -214 -> 165
    //   382: fconst_0
    //   383: fstore 19
    //   385: iconst_0
    //   386: istore 20
    //   388: iconst_0
    //   389: istore 4
    //   391: iconst_0
    //   392: istore 5
    //   394: goto -265 -> 129
    //
    // Exception table:
    //   from	to	target	type
    //   17	53	210	java/lang/Exception
    //   251	285	288	org/json/JSONException
    //   17	53	293	finally
    //   177	209	336	finally
    //   338	341	336	finally
    //   300	334	344	org/json/JSONException
    //   53	59	349	finally
    //   59	114	358	finally
    //   218	251	358	finally
    //   53	59	362	java/lang/Exception
    //   59	114	372	java/lang/Exception
    //   129	165	377	org/json/JSONException
  }

  public void open(final String paramString)
  {
    try
    {
      if ((paramString.startsWith("http://")) || ((paramString.contains("https")) && (!paramString.contains("play.google.com")) && (!paramString.contains("market.android.com")) && (!paramString.contains("market%3A%2F%2F"))))
      {
        if (!URLUtil.isValidUrl(paramString))
        {
          this.a.raiseError("Invalid url", "open");
          return;
        }
        localIntent = new Intent(this.b, IMBrowserActivity.class);
        Log.debug("IMRE_3.7.0", "IMWebView-> open:" + paramString);
        localIntent.putExtra("extra_url", paramString);
        if ((this.a.getStateVariable() == IMWebView.ViewState.DEFAULT) && (!this.a.mIsInterstitialAd) && (!this.a.mWebViewIsBrowserActivity))
          localIntent.putExtra("FIRST_INSTANCE", true);
        IMBrowserActivity.setWebViewListener(this.a.mListener);
      }
    }
    catch (ActivityNotFoundException localActivityNotFoundException)
    {
      try
      {
        Intent localIntent;
        this.b.startActivity(localIntent);
        if (this.a.mWebViewIsBrowserActivity)
          return;
        this.a.fireOnShowAdScreen();
        return;
        localActivityNotFoundException = localActivityNotFoundException;
        Log.debug("IMRE_3.7.0", "Failed to perform mraid Open");
        return;
      }
      catch (Exception localException2)
      {
        this.a.raiseError("Invalid url", "open");
        return;
      }
    }
    catch (Exception localException1)
    {
      this.a.raiseError("Invalid url", "open");
      return;
    }
    new Thread(new a(paramString)).start();
  }

  class a
    implements Runnable
  {
    a(String arg2)
    {
    }

    public void run()
    {
      String str = InternalSDKUtil.getFinalRedirectedUrl(paramString);
      Intent localIntent;
      if (str != null)
      {
        localIntent = new Intent();
        localIntent.setAction("android.intent.action.VIEW");
        localIntent.setData(Uri.parse(str));
        localIntent.addFlags(268435456);
      }
      try
      {
        MRAIDBasic.a(MRAIDBasic.this).startActivity(localIntent);
        if (MRAIDBasic.b(MRAIDBasic.this).mListener != null)
          MRAIDBasic.b(MRAIDBasic.this).mListener.onLeaveApplication();
        return;
      }
      catch (Exception localException)
      {
        MRAIDBasic.b(MRAIDBasic.this).raiseError("Invalid url", "open");
      }
    }
  }
}

/* Location:           E:\android\Toy Defense 2_dex2jar.jar
 * Qualified Name:     com.inmobi.re.container.mraidimpl.MRAIDBasic
 * JD-Core Version:    0.6.2
 */